﻿<UserControl x:Class="App16.Controls.LoginControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="using:App16.Controls"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             HorizontalAlignment="Right"
             VerticalAlignment="Top"
             Background="Black"
             d:DesignHeight="100"
             d:DesignWidth="320"
             mc:Ignorable="d">

    <UserControl.DataContext>
        <local:LoginControlViewModel />
    </UserControl.DataContext>

    <Button Style="{StaticResource TextBlockButtonStyle}">
        <Button.Resources>
            <Style TargetType="TextBlock">
                <Setter Property="TextAlignment" Value="Right" />
                <Setter Property="FontWeight" Value="Light" />
                <Setter Property="TextTrimming" Value="CharacterEllipsis" />
            </Style>
        </Button.Resources>
        <Button.Flyout>
            <MenuFlyout Placement="Bottom">
                <MenuFlyout.MenuFlyoutPresenterStyle>
                    <Style TargetType="MenuFlyoutPresenter">
                        <Setter Property="MinWidth" Value="320" />
                    </Style>
                </MenuFlyout.MenuFlyoutPresenterStyle>
                <MenuFlyoutItem Command="{Binding LoginCommand}" Text="LOGIN" />
                <MenuFlyoutItem Command="{Binding LogoutCommand}" Text="LOGOUT" />
            </MenuFlyout>
        </Button.Flyout>
        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
            <StackPanel Margin="10,0">
                <TextBlock FontSize="30" Text="{Binding Name}" />
                <TextBlock FontSize="20" Text="{Binding Email}" />
            </StackPanel>
            <Grid Width="75" Height="75">
                <Rectangle Fill="Gainsboro" />
                <ProgressRing Margin="10"
                              HorizontalAlignment="Stretch"
                              VerticalAlignment="Stretch"
                              IsActive="True"
                              Visibility="{Binding ProgressVisibility}" />
                <Image Source="{Binding Image}" />
            </Grid>
        </StackPanel>
    </Button>

</UserControl>
